<?php 
	$subject = $_SERVER['REQUEST_URI'];
	
?>
<div id="mainMenu">
	<?php
		$loginStatus = $facebookAPI->checkLoginStatus();
		
		if($loginStatus && strpos($subject,'index.php')){
			echo '<ul class="floatLeft">';
			echo '<li><a id="editSubscription" href="editArea.php" title="編輯" >編輯</a></li>';
			echo '</ul>';		
		}
	?>
	
    <ul class="floatRight">
    	<?php
			foreach($tags as $key=>$term){
				$pattern = "/".$key."/";
				if(preg_match($pattern, $subject)){
					echo '<li><a href="'.$host_path.$key.'.php" title="'.$key.'" class="here">'.$term.'</a></li>';
				}
				else{
					echo '<li><a href="'.$host_path.$key.'.php" title="'.$key.'">'.$term.'</a></li>';	
				}
			}
			/*
			 * facebook login tag
			 */ 
			
			if($loginStatus){
				//echo '<li>Hi,'.$_SESSION['LOGIN_INFO']['name'].'</li>';
				echo '<li><a href="lib/actions/logout.php" title="Logout">登出</a></li>';
					
			}
			else{
				//echo '<li><a href="https://www.facebook.com/dialog/oauth?client_id='.APP_ID.'&redirect_uri='.REDIRECT_URI.'" title="Login">Login with Facebook</a></li>';
				echo '<li><a href="lib/actions/login.php" title="Login">Login with Facebook</a></li>';
			}
			
		?>
     
      <!--<li><a href="http://fullahead.org/contact.html" title="Get in touch" class="last">Mail</a></li>-->
    </ul>
  </div>